<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$title?></title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="style/jquery.treeview.css" />
<link rel="stylesheet" href="style/screen.css" />


<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/jquery.cookie.js" type="text/javascript"></script>

<script src="js/ajax_main_template.js" type="text/javascript"></script>


<script type="text/javascript" src="popup-window.js"></script>
<link rel="stylesheet" type="text/css" href="popup-window.css" />
<link rel="stylesheet" type="text/css" href="admin/css/style.css"/>

<link href="calendar/calendar.css" rel="stylesheet" type="text/css" />

<script language="javascript" src="calendar/calendar.js"></script>

<link rel="icon" href="images/erp.ico" type="image/x-icon" />
<link rel="shortcut icon" href="images/erp.ico" type="image/x-icon" />


<script src="js/jquery.treeview.js" type="text/javascript"></script>


<script type="text/javascript" src="admin/js/jquery-1.8.0.min.js"></script>	
<script type="text/javascript" src="admin/js/jquery-ui-1.8.23.custom.min.js"></script>
<link type="text/css" href="admin/css/ui-lightness/jquery-ui-1.8.23.custom.css" rel="stylesheet" />

<script>
	$(document).ready(function(){
		$('.back-button').click(function(){
			window.history.back();	
		});
	});
	function popuploadbel(ele){
		var popID = $(ele).attr('rel'); //Get Popup Name
	    var popURL = $(ele).attr('href'); //Get Popup href to define size
	                    
	    //Pull Query & Variables from href URL
	    var query= popURL.split('?');
	    var dim= query[1].split('&');
	    var popWidth = dim[0].split('=')[1]; //Gets the first query string value

	    //Fade in the Popup and add close button
	    $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><span class="btn_close">X</span></a>');
	    
	    //Define margin for center alignment (vertical + horizontal) - we add 80 to the height/width to accomodate for the padding + border width defined in the css
	    var popMargTop = ($('#' + popID).height() + 80) / 2;
	    var popMargLeft = ($('#' + popID).width() + 80) / 2;
	    
	    //Apply Margin to Popup
	    $('#' + popID).css({ 
	            'margin-top' : -popMargTop,
	            'margin-left' : -popMargLeft
	    });
	    
	    //Fade in Background
	    $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
	    $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer 
	    $('a.close, #fade, .iclose').live('click', function() { //When clicking on the close or fade layer...
	        $('#fade , .popup_block').fadeOut(function() {
	              $('#fade, a.close').remove();  
		}); //fade them both out
		      
		      return false;
		});
	}
</script>
<script type="text/javascript">

function reloadMainTemplate() {
	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp = new XMLHttpRequest();
	} else {// code for IE6, IE5
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			var xml_re = xmlhttp.responseXML;
			if (xml_re!=null) {
				if(xml_re.getElementsByTagName("my_received")!=null){		
					var num_save = xml_re.getElementsByTagName("num_re_pending");		
					document.getElementById("num_re_pending").innerHTML = num_save[0].childNodes[0].nodeValue;
					
					num_save = xml_re.getElementsByTagName("num_re_not_approve");		
					document.getElementById("num_re_not_approve").innerHTML = num_save[0].childNodes[0].nodeValue;
					
					num_save = xml_re.getElementsByTagName("num_re_approved");		
					document.getElementById("num_re_approved").innerHTML = num_save[0].childNodes[0].nodeValue;
					
					num_save = xml_re.getElementsByTagName("num_re_declined");		
					document.getElementById("num_re_declined").innerHTML = num_save[0].childNodes[0].nodeValue;
					
					num_save = xml_re.getElementsByTagName("num_re_reference_approved");		
					document.getElementById("num_re_reference_approved").innerHTML = num_save[0].childNodes[0].nodeValue;
					
					num_save = xml_re.getElementsByTagName("num_re_reference_waiting");		
					document.getElementById("num_re_reference_waiting").innerHTML = num_save[0].childNodes[0].nodeValue;
					
					num_save = xml_re.getElementsByTagName("num_re_received_metting");		
					document.getElementById("num_re_received_metting").innerHTML = num_save[0].childNodes[0].nodeValue;
				
				}
				
				if(xml_re.getElementsByTagName("my_document")!=null){		
					var num_save = xml_re.getElementsByTagName("num_my_sendingDoc");		
					document.getElementById("num_my_sendingDoc").innerHTML = num_save[0].childNodes[0].nodeValue;
					
					num_save = xml_re.getElementsByTagName("num_my_savedDoc");		
					document.getElementById("num_my_savedDoc").innerHTML = num_save[0].childNodes[0].nodeValue;
					
					num_save = xml_re.getElementsByTagName("num_my_approveDoc");		
					document.getElementById("num_my_approveDoc").innerHTML = num_save[0].childNodes[0].nodeValue;
					
					num_save = xml_re.getElementsByTagName("num_my_declinedDoc");		
					document.getElementById("num_my_declinedDoc").innerHTML = num_save[0].childNodes[0].nodeValue;
					
					num_save = xml_re.getElementsByTagName("num_my_meetingDoc");		
					document.getElementById("num_my_meetingDoc").innerHTML = num_save[0].childNodes[0].nodeValue;
				
				}
				
				if(xml_re.getElementsByTagName("my_re_bin")!=null){		
					var num_save = xml_re.getElementsByTagName("num_bin_re_doc");		
					document.getElementById("num_bin_re_doc").innerHTML = num_save[0].childNodes[0].nodeValue;
					
					num_save = xml_re.getElementsByTagName("num_bin_send_doc");		
					document.getElementById("num_bin_send_doc").innerHTML = num_save[0].childNodes[0].nodeValue;
				
				}
			}
		}
	}
	xmlhttp.open("GET", "ajax/main_template.php?employeeID="+<?=$id_employee?>, true);
	xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
	xmlhttp.send();
}


function showUser(str)
{
	if (str==""){
		document.getElementById("txtHint").innerHTML="";
		return;
	} 
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
										    	document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
										  }
									  }
	xmlhttp.open("GET","ajax/getuser.php?q="+str,true);
	xmlhttp.send();
}
function showReference(str)
{ 
	if (str==""){
		document.getElementById("txtHint1").innerHTML="";
		return;
	} 
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
										    	document.getElementById("txtHint1").innerHTML=xmlhttp.responseText;
										  }
									  }
	xmlhttp.open("GET","ajax/getreference.php?idemployee="+str,true);
	xmlhttp.send();
}
function rmReference(str)
{ 
	if (str==""){
		document.getElementById("txtHint1").innerHTML="";
		return;
	} 
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
										    	document.getElementById("txtHint1").innerHTML=xmlhttp.responseText;
										  }
									  }
	xmlhttp.open("GET","ajax/rmreference.php?idemployee="+str,true);
	xmlhttp.send();
}
</script>
<script type="text/javascript">
function focusOnLoadNewForm(){
    document.getElementById("title").focus();
}
function LoadMenu(){
			$("#tree").treeview({
				collapsed: true,
				animated: "medium",
				control:"#sidetreecontrol",
				persist: "location"
			});
			}
		
	</script>



</head>
<?
$database = $_SESSION['db'];

$rlogo =$_SESSION['Logo'];

?>
<body>

	<div id="mainframe">
		<div id="header">
			<div style="float: left;width: 230px;height: 60px;"><a href=""> <?php if ($rlogo==""){?> <img
				src="images/nophoto.png" alt="" /> <?php }else{?> <img
				src="<?php echo $rlogo?>" alt="" style="height: 60px;"/> <?php }?> </a></div>
			<div class="account">
				<form action="operations/set_lang.php" method="post">
					<ul class="lang">
						<li><a href="view-profile-admin.php"><img src="images/icon_06.png" /> <?=$username?> </a>
						</li>
						<li><a href="logout.php"><img src="images/icon_08.png" /> <?=$l_logout?>
						</a></li>

						<li style="padding: 0"><input type="submit" value="" name="bt-en"
							class="en" /></li>
						<li style="padding: 0"><input type="submit" value="" name="bt-kr"
							class="kr" /></li>
						<li style="padding: 0"><input type="submit" value="" name="bt-vn"
							class="vn" /></li>
					</ul>


				</form>
			</div>
			<!--end account-->
		</div>
		<!--end header-->
		<table class="mainf" width="100%" border="0" cellspacing="0"
			cellpadding="0">
			<tr>
				
				<td style="vertical-align: top;width: 300px" id="menuleftAdmin">
			
					<?php 
						include 'menuLeftAdmin.php';
					?>
				
				</td>
				<td style="vertical-align: top">

					<div id="contains">
					<?php require_once($content) ;?>
						<div class="footer" id="footer">
							<span>&copy; 2011 Elisoft - All right reserved</span>
						</div>
					</div>
				</td>
			</tr>
		</table>

	</div>
<?php mysql_close($connection);?>
</body>
</html>
